﻿using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
using SuperSocket;
using SuperSocket.Channel;
using SuperSocket.Server;
using Microsoft.Extensions.DependencyInjection;

namespace MSocketCore.MSocket
{
    public class MyServer<TReceivePackageInfo> : SuperSocketService<TReceivePackageInfo>
        where TReceivePackageInfo : class
    {
        private readonly IServiceProvider _serviceProvider;

        public MyServer(IServiceProvider serviceProvider, IOptions<ServerOptions> serverOptions)
            : base(serviceProvider, serverOptions)
        {
            _serviceProvider = serviceProvider;
        }

        protected override async ValueTask OnSessionConnectedAsync(IAppSession session)
        {
            await base.OnSessionConnectedAsync(session);
        }

        protected override async ValueTask OnSessionClosedAsync(IAppSession session, CloseEventArgs e)
        {
            await base.OnSessionClosedAsync(session,e);
        }


        protected override async ValueTask OnStartedAsync()
        {
            
        }

        protected override async ValueTask OnStopAsync()
        {
        }
    }
}